// Magic Software, Inc.
// http://www.magic-software.com
// Copyright (c) 2000, All Rights Reserved
//
// Source code from Magic Software is supplied under the terms of a license
// agreement and may not be copied or disclosed except in accordance with the
// terms of that agreement.  The various license agreements may be found at
// the Magic Software web site.  This file is subject to the license
//
// RESTRICTED USE SOURCE CODE
// http://www.magic-software.com/License/restricted.pdf

#include "MgcOglRenderer.h"

//----------------------------------------------------------------------------
void MgcOglRenderer::SetMaterialState (MgcMaterialState* pkState)
{
    GLfloat afColor[4];
    afColor[3] = 1.0;

    afColor[0] = pkState->Emissive().r;
    afColor[1] = pkState->Emissive().g;
    afColor[2] = pkState->Emissive().b;
    glMaterialfv(GL_FRONT,GL_EMISSION,afColor);

    afColor[0] = pkState->Ambient().r;
    afColor[1] = pkState->Ambient().g;
    afColor[2] = pkState->Ambient().b;
    glMaterialfv(GL_FRONT,GL_AMBIENT,afColor);

    afColor[0] = pkState->Diffuse().r;
    afColor[1] = pkState->Diffuse().g;
    afColor[2] = pkState->Diffuse().b;
    glMaterialfv(GL_FRONT,GL_DIFFUSE,afColor);

    afColor[0] = pkState->Specular().r;
    afColor[1] = pkState->Specular().g;
    afColor[2] = pkState->Specular().b;
    glMaterialfv(GL_FRONT,GL_SPECULAR,afColor);

    glMaterialf(GL_FRONT,GL_SHININESS,pkState->Shininess());
}
//----------------------------------------------------------------------------
